package com.shopping.runbackground.coupons.controller;


import com.shopping.entity.Result;

import com.shopping.runbackground.coupons.api.pojo.StoreCoupons;
import com.shopping.runbackground.coupons.service.StoreCouponsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * (StoreCoupons)表控制层
 *
 * @author 邓琛超
 * @since 2020-06-02 10:30:24
 */
@RestController
@RequestMapping("/storeCoupons")
public class StoreCouponsController {
    /**
     * 服务对象
     */
    @Resource
    private StoreCouponsService storeCouponsService;

    @GetMapping("/selectall")
    public List<StoreCoupons> selectOne(Integer id) {
        List<StoreCoupons> all=storeCouponsService.findall();
        return all;
    }

    @GetMapping("/findstoreCoupons/{sid}/{ename}")
    public Result<StoreCoupons> findstoreCoupons(@PathVariable("sid")String sid,@PathVariable("ename")String ename,@RequestParam("currentPage") Integer currentPage,@RequestParam("pageSize") Integer pageSize){
        List<StoreCoupons>list= storeCouponsService.queryAllByLimits(sid,ename,currentPage,pageSize);

        return new Result<StoreCoupons>(true,12332,"啦啦啦",list);
    }

}